package com.baoyouqun.service;

import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baoyouqun.domain.CreateCmd.UserResourceCreateCmd;
import com.baoyouqun.domain.Enum.ResourceTypeEnum;
import com.baoyouqun.domain.Query.UserResourceQuery;
import com.baoyouqun.domain.UpdateCmd.UserResourceUpdateCmd;
import com.baoyouqun.domain.VO.UserResourceVO;
import com.baoyouqun.entity.UserResource;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;


public interface UserResourceService extends IService<UserResource> {


    /**
     * 新增并返回实体
     */
    SingleResponse<UserResourceVO> create(UserResourceCreateCmd cmd);

    Response update(UserResourceUpdateCmd cmd);

    /**
     * 根据ID查询VO
     */
    UserResourceVO selectById(String id);

    /**
     * 分页查询VO
     */
    IPage<UserResourceVO> pageVo(UserResourceQuery query);

    void handleResource(String id, List<UserResourceCreateCmd> resourceList);

    void deleteByUserId(String id);

    Map<String, List<String>> getUserResourcesMap(List<String> friendIds);

    Map<String, List<String>> getUserNeedsMap(List<String> friendIds);

    List<UserResourceVO> selectByUserId(String userId);

    Map<String, Integer> countByUserIds(List<String> userIds);

    Collection<String> selectUserIdsByTypeAndResourceIds(ResourceTypeEnum resourceTypeEnum, Set<String> needResourceIds);
}